package com.sinosoft.bee.services.proposal.service.impl;

import com.sinosoft.bee.services.proposal.entity.proposal.ProposalInsured;
import com.sinosoft.bee.services.proposal.service.InsuredInfoService;
import com.sinosoft.bee.services.proposal.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author: TrickerL
 * @Description: bee
 * @Date: Create in 15:18 2018/5/16
 * @Modified By:
 */
@Service
@Transactional
public class InsuredInfoServiceImpl implements InsuredInfoService {

    @Autowired
    private InsuredInfoMapper insuredInfoMapper;

    /**
     * 新增被保人信息
     * @param insured
     * @return
     */
    @Override
    public Integer insertProposalInsuredInfo(ProposalInsured insured){
        return insuredInfoMapper.insertInsuredInfo(insured);
    }

    /**
     * 删除被保人信息
     * @param insured
     */
    @Override
    public void deleteInsuredInfo(ProposalInsured insured){
        insuredInfoMapper.deleteAppntInfo(insured);
    }

    /**
     * 查询所有被保人信息
     * @return
     */
    @Override
    public List<ProposalInsured> selectAllInsured(){
            return insuredInfoMapper.selectAllInsured();
    }

    /**
     * 通过被保人ID修改信息
     * @param insured
     */
    @Override
    public void updateById(ProposalInsured insured){
        insuredInfoMapper.updateById(insured);
    }
}
